package com.hunan.api.catv.entity.enums;

/**
 * 资讯类型
 */
public enum NewsType {
    news(1, "图文"),
    miniVideo(2, "短视频");

    private final Integer code;

    private final String msg;

    NewsType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public static NewsType getResult(int code) {
        NewsType[] rcs = NewsType.values();
        for (NewsType rc : rcs) {
            if (rc.getCode().equals(code)) {
                return rc;
            }
        }
        return null;
    }
}
